1. Field of the Invention
The present invention relates to a peer-to-peer (P2P) communication system having a plurality of node devices which can communicate with each other via a network.
2. Discussion of the Related Art
A technique called “Application Layer Multicast (ALM)” is known, which relays and distributes a content data stream while maintaining a content data distribution (broadcast) path in an application layer. For example, in a tree-shaped broadcasting system disclosed in Japanese Unexamined Patent Application Publication No. 2006-33514, a plurality of node devices participating in the system are connected in a tree shape via a network while forming a plurality of hierarchical levels with a broadcast station (for example, a broadcast apparatus) as a root at the highest level, and content data broadcasted from the broadcast station is sequentially transferred (relayed) from a node device in a high hierarchical level to a node device in a low hierarchical level. With such a technique, each of the node devices copies a plurality of packets of content data a predetermined number of times in an application layer. Each node device sends the copied packets to a node device one level lower in the hierarchy, receives the packets from a node one level higher in the hierarchy and relays the packets to a node one level lower in the hierarchy. The number of times to copy the packets at a node device equals the number of node devices that are one level lower in the hierarchy connected to it. Thus, in the tree-shaped broadcasting system that distributes contents from the broadcast station to node devices connected to the broadcast station in low hierarchical levels, the contents can be multi-casted to the node devices with the smaller number of relay levels.
In such a technique, terminal devices of the users are used as relay node devices. Consequently, even if the quality of an access line to which the terminal devices are connected is stable, a packet to be relayed depending on the network use situations of the terminal devices tends to be lost between the terminal devices. An ALM program is implemented so as to immediately relay a packet received from a node device to node devices that are one level lower in the hierarchy. If a packet is lost in a node device, the lost packet is immediately propagated toward the node devices that are one level lower in hierarchy.
Usually, a terminal device having an ALM program installed, receives a packet from a terminal device one level higher in the hierarchy and stores the packet into a buffer memory such as a ring buffer. By checking continuity of sequence numbers of packets at this time, a node device where a packet loss event occurs can be found. For a packet whose loss is detected, a packet complement request is sent to a node device at one level higher than the node where the packet loss is detected in the hierarchy. The packet complement request means that a node device which finds a packet loss event asks the other node device at one level higher in the hierarchy whether a complementary packet is stored. The node device in the immediate higher hierarchical level determines whether a complementary packet is stored in its buffer memory. When the complementary packet is stored, the node device transmits the complementary packet to the node device sending the packet complement request. When the complementary packet is not stored in buffer memory, the node device transfers the packet complement request to a node device at one level higher than itself in the hierarchy.